<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .btn{
            display: inline-block;
            margin-bottom: 0;
            font-weight: 400;
            text-align: center;
            white-space: nowrap;
            vertical-align: middle;
            -ms-touch-action: manipulation;
            touch-action: manipulation;
            cursor: pointer;
            background-image: none;
            border: 1px solid transparent;
            padding: 6px 12px;
            font-size: 14px;
            line-height: 1.42857143;
            border-radius: 4px;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        .btn.danger{
            background: #f56;
            color: white;
        }

        .btn.primary{
            background: #56f;
            color: white;
        }
    </style>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">
        /**
         * Button
         *      - type  
         *          - danger  红色
         *          - primary 蓝色
         *      - style 
         *          - 自定义样式
         *      - 标签文本
         *          - children
         */
        class Button extends React.Component{
            render(){
                // console.log(this.props);
                // danger
                return <button className={"btn " + this.props.type} style={this.props.style}>{this.props.children}</button>
            }
        }

        class App extends React.Component{
            render(){
                return <Button type="primary" style={{padding: '10px 20px'}}>点我抽奖 xxxx </Button>;
            }
        }

        //渲染
        ReactDOM.render(<App />, document.querySelector("#root"));
    </script>
</body>
</html>